#ifndef __TYPING_H__
#define __TYPING_H__


#include "cocos2d.h"

USING_NS_CC;

class Typing_Layer : public cocos2d::CCLayer
{
public:
	Typing_Layer();
	~Typing_Layer();
	CREATE_FUNC(Typing_Layer);

	virtual bool init();


private:
	enum SelectedButton
	{
		SelectNull,
		ButtomAccount,
		ButtomPassword,
		ButtonEnter,
		ButtomCancel,
	};
	int GetType(int i);
	SelectedButton _SelectedButton;
	void GetSelectedButtom(CCObject* pObject);
	virtual void update(float second);
	CCSprite* BackGround;
	CCSprite* AccountTyping;
	CCSprite* PassWordTyping;
	CCSprite* EnterButton_Normal;
	CCSprite* CancelButton_Normal;
	CCMenuItemSprite* Buttom_Account;
	CCMenuItemSprite* Buttom_PassWord;
	CCMenuItemSprite* Buttom_Enter;
	CCMenuItemSprite* Buttom_Cancel;
	CCLabelTTF* EnterText;
	CCLabelTTF* CancelText;
	CCLabelTTF* AccountText;
	CCLabelTTF* PassWordText;

	CCLabelTTF* AccountTypeText;
	CCLabelTTF* PassWordTypeText;
	std::string AccountTypeTextString;
	std::string PassWordTypeTextString;
	void PressUpdate();
	void onKeyPressed(EventKeyboard::KeyCode keyCode, Event* event);
	void onKeyReleased(EventKeyboard::KeyCode keyCode, Event* event);
};



class Typing_Scene : public cocos2d::CCScene
{
public:
	Typing_Scene();
	~Typing_Scene();

	static cocos2d::Scene* createScene();

	CREATE_FUNC(Typing_Scene);

	virtual bool init();


private:
	Typing_Layer* _Typing_Layer;
};



#endif